package com.company.poker.channel;

import com.company.poker.protocol.ByteMessage;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;

/**
 * Description of class.
 * Created 4/25/13 5:53 PM
 *
 * @author andrey.rodin@playtech.com
 */

public class EndpointRouter extends RouteBuilder {
    private final ChannelContext context;

    public EndpointRouter(ChannelContext context) {
        this.context = context;
    }


    @Override
    public void configure() throws Exception {
        from("netty:tcp://localhost:1234?allowDefaultCodec=false&decoders=#myDecoder,myDecoder1").process(new Processor() {
            @Override
            public void process(Exchange exchange) throws Exception {
                ByteMessage msg = (ByteMessage) exchange.getIn().getBody();
//                msg.setPoet("Dr. Sarojini Naidu");
//                exchange.getOut().setBody(poetry);
            }
        })
                .to("akka://poker/user/MyEndpoint");
    }


}
